# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=ksvg
pkgver=6.1.0
pkgrel=0
pkgdesc="Configuration system"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND LGPL-2.0-only AND LGPL-2.1-or-later"
makedepends="
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qtdeclarative-dev
	qt6-qttools-dev
	karchive-dev
	kconfig-dev
	kcolorscheme-dev
	kcoreaddons-dev
	kguiaddons-dev
	kirigami-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/ksvg.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/ksvg-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E 'ksvg(core-(ksvgtest|kdesktopfiletest|test_kconf_update)|gui-kstandardshortcutwatchertest)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
7000c407875682df8d847222ce0fc0ef87425562e844da98f0954829db53547f1a84382c5119446bf973aa71c841f58a40b478236413f5c3a04b45841563d05f  ksvg-6.1.0.tar.xz
"
